<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Special Needs Pets - Kalamazoo Animal Rescue</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<? include("head.inc");  ?>


</head>

<body>

<!--initial body width and height set up  -->

<div id="bodywidth">

<? include("./includes/header.inc");  ?>
<? include("./includes/leftmenu.inc");  ?>

<!-- place wide2column below -->
<div id="wide2column"><BR>
<CENTER><H2>Special Needs Pets</H2></CENTER>
  <p><BR>
    Do you have it in your heart to adopt an animal with special needs?&nbsp;&nbsp;
    Here are some animals that haven't had things go their way in life and now need special homes.&nbsp;&nbsp;A patient loving family is needed - a family that will give him/her a new break, lots of love, attention, shelter, food, water and proper vet care.</p>
<HR WIDTH="95%" ALIGN=CENTER><BR>

  
<!-- This section is maintained manually. Thumbnails of special needs animal are stored in the www/images/special/ folder -->
 
<p style="margin-left:20px;font-size:124%;font-weight:bold;">
Select the picture for a larger image and detailed description.
</p>
<BR>

<?php


include("./includes/db.php");
include("./includes/count.php");
				// Connect to the database server
dbConnect('kar_web1');   	// Use function in db.php to connect


$numresults = @mysql_query("SELECT * FROM cats, dogs  WHERE spec_need=1 AND
						pet_status='v'");
if (!$numresults) {	
  echo("<p>Error performing query in Display Pets page: " . mysql_error() . "</p>");
  exit();
}

$num_to_display=20;  			//  how many animals we want displayed per page
$num_columns=5;				// how many columns we want those split between

$num_pets=mysql_num_rows($numresults); // how many total animals are actually available

if (empty($starting_num)){	// if this is our first page, then start at 0
	$starting_num=0;
} //  end if

$result = @mysql_query("SELECT * FROM cats, dogs
				   WHERE spec_need=1 AND pet_status='v'  
				   LIMIT $starting_num,$num_to_display");


$count =mysql_num_rows($result);  // how many we have for this page
displayPageLinks($num_pets, $num_to_display, $starting_num);


for ($i = 1; $i <= $count; $i++ ) {    	// loop for number of animals in this set
	$pet_record = mysql_fetch_array($result);
	$temp_id = $pet_record["pet_id"];
	$name = $pet_record["pet_name"];
	$special = $pet_record["spec_need"];
	$noPhotos = $pet_record["noPhotos"];

	//  Query Pet Photos separately in case there is not a record of photos for this pet
	$pics = @mysql_query("SELECT * FROM petPics WHERE pet_id ='$temp_id'");
	$pet_pics = mysql_fetch_array($pics);

	if ($noPhotos) {
		$thumb = 'noPhotos.gif';	// this file is in both the dog and cat thumbnail folders
		} else {
		$thumb = $pet_pics["thumb"];
		}
	
	if ($pet_record["pet_type"] == 'c'):	// Set path to look in cat or dog images
		$path = "http://www.kalamazooanimalrescue.org/images/cats/thmbnail/";
		$type = "cat";
	else:
		$path = "http://www.kalamazooanimalrescue.org/images/dogs/thmbnail//";
		$type = "dog";
	endif;


	echo ("<div class =\"float\">");   // no matter what start display pet thumbnails with this

							// display pet thumbnail image and name
	echo("<a href='pets2.php?displaypet=$temp_id'><img SRC=\"". $path . $thumb . "\" align=\"$align\"  alt=\"$name\"  width=\"75\" height=\"75\"></a>" );

 	echo("<BR><p>");   //move below photo and start caption paragraph

//  Commenting out because we don't need to show the heart since all these pets are special needs
//	if ($special=='1'):		// special needs
//		echo("<img SRC=\"http://www.kalamazooanimalrescue.org/images/sneed3.gif\"  HSPACE=0 ALIGN=\"TOP\" WIDTH=\"17\" HEIGHT=\"17\" ALT=\"Sp Needs\">" . $name . "</p></div>");
//	else:
//		echo($name . "</p></div>");
//	endif;

		echo($name . "</p></div>");


	if ( ($i%$num_columns) == 0):	// if it's the last slot in the row, end the row
//		echo ("</TD></TR>");
		echo("<div class=\"clearit\"></div>");
//	else:
//		echo ("</TD>");
	endif;
  
}  // end for 

	echo("<div class=\"clearit\"></div>");    // move down to next line after all images posted




displayPageLinks($num_pets, $num_to_display, $starting_num, $my_rand);
?>
<!-- 
<img SRC="http://www.kalamazooanimalrescue.org/images/sneed3.gif"  HSPACE=0 ALIGN="TOP" WIDTH="17" HEIGHT="17" ALT="Special Needs"> denotes Special Needs -->

<BR><BR>

<CENTER>Check out  our other <a href="cats.php">cats</a>, <a href="kittens.php">kittens</a> and <a href="dogs.php">dogs.</a><BR></CENTER><BR>


<BR>

</div>

<? include("footer.inc");  ?>

<!--tag below ends bodywidth div -->
</div>
</body>
</html>
